using INTEX.DataBase;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class VWASTKE
    {
        VBSFARB _VBF;
        public VBSFARB VBF
        {
            get
            {
                if (_VBF == null) _VBF = new VBSFARB();
                return _VBF;
            }
        }
        VBSSATZ _VBS;
        public VBSSATZ VBS
        {
            get
            {
                if (_VBS == null) _VBS = new VBSSATZ();
                return _VBS;
            }
        }
        VBHSATZ _VBH;
        public VBHSATZ VBH
        {
            get
            {
                if (_VBH == null) _VBH = new VBHSATZ();
                return _VBH;
            }
        }
        VBASTGA _VBG;
        public VBASTGA VBG
        {
            get
            {
                if (_VBG == null) _VBG = new VBASTGA();
                return _VBG;
            }
        }

        public DataSet LOADBYWF(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            dwData["WAKMANDANT"] = app.Mandant;
            dwData["WAKART"] = pm["ART"].ToString();
            dwData["WAKVAR"] = pm["VAR"].ToString().Trim().PadRight(2);
            dwData["WAKWCOL"] = pm["FARBE"].ToString();            
            SResult = QWAK01(dwData);
            return SResult;
        }
        public DataSet CREATEBYWF(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            dwData["WAKMANDANT"] = app.Mandant;
            dwData["WAKART"] = pm["ART"].ToString();
            dwData["WAKVAR"] = pm["VAR"].ToString();
            dwData["WAKWCOL"] = pm["FARBE"].ToString();
            dwData["WAKKART"] = pm["ART"].ToString();
            dwData["WAKKVAR"] ="01";
            dwData["WAKKFARBE"] = pm["FARBE"].ToString();          
            dwData["WAKPOS"] = "01";
            TBMain.Rows.InsertAt(dwData, 0);
            InsertWASTKE(dwData);
            return SResult;
        }
        public virtual void Copy(Dictionary<string, object> pm)
        {
            string tart = (string)pm["TART"];
            string sart = (string)pm["SART"];
            dwData = TBMain.NewRow();
            dwData["WAKMANDANT"] = app.Mandant;
            dwData["WAKART"] = sart;
            dwData["WAKVAR"] = "".PadRight(2); 
            SResult = QWAK03(dwData);
            foreach (DataRow dwSrc in SResult.Tables[0].Rows)
            {   
                dwData = TBMain.NewRow();
                dwData.ItemArray = dwSrc.ItemArray;
                dwData["WAKART"] = tart.PadRight(20);
                dwData["WAKKART"] = tart.PadRight(20);
                TBMain.Rows.InsertAt(dwData, 0);
                DWAK01(dwData);
                InsertWASTKE(dwData);
            }
        }
    }
    public partial class VWASTKE
    {
        public string WAKART { get { if (dwMaster == null) return ""; return dwMaster["WAKART"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKART"] = value; OnPropertyChanged("WAKART", value); } } //lENGth 20
        public string WAKVAR { get { if (dwMaster == null) return ""; return dwMaster["WAKVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKVAR"] = value; OnPropertyChanged("WAKVAR", value); } } //lENGth 2
        public string WAKWCOL { get { if (dwMaster == null) return ""; return dwMaster["WAKWCOL"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKWCOL"] = value; OnPropertyChanged("WAKWCOL", value); } } //lENGth 10
        public string WAKPOS { get { if (dwMaster == null) return ""; return dwMaster["WAKPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKPOS"] = value; OnPropertyChanged("WAKPOS", value); } } //lENGth 2
        public string WAKKART { get { if (dwMaster == null) return ""; return dwMaster["WAKKART"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKKART"] = value; OnPropertyChanged("WAKKART", value); } } //lENGth 20
        public string WAKKVAR { get { if (dwMaster == null) return ""; return dwMaster["WAKKVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKKVAR"] = value; OnPropertyChanged("WAKKVAR", value); } } //lENGth 2
        public string WAKKFARBE { get { if (dwMaster == null) return ""; return dwMaster["WAKKFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKKFARBE"] = value; OnPropertyChanged("WAKKFARBE", value); } } //lENGth 10

        #region======ColumnSchema==========
        /*
                 public string WAKMANDANT { get { if (dwMaster == null) return ""; return dwMaster["WAKMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKMANDANT"] = value; OnPropertyChanged("WAKMANDANT", value); } } //lENGth 2
                 public string WAKKUNDNR { get { if (dwMaster == null) return ""; return dwMaster["WAKKUNDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKKUNDNR"] = value; OnPropertyChanged("WAKKUNDNR", value); } } //lENGth 8
                 public string WAKWERK { get { if (dwMaster == null) return ""; return dwMaster["WAKWERK"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKWERK"] = value; OnPropertyChanged("WAKWERK", value); } } //lENGth 3
                 public string WAKBAUMKZ { get { if (dwMaster == null) return ""; return dwMaster["WAKBAUMKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKBAUMKZ"] = value; OnPropertyChanged("WAKBAUMKZ", value); } } //lENGth 1
                 public string WAKVERWEN { get { if (dwMaster == null) return ""; return dwMaster["WAKVERWEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKVERWEN"] = value; OnPropertyChanged("WAKVERWEN", value); } } //lENGth 1
                 public string WAKANZBA { get { if (dwMaster == null) return ""; return dwMaster["WAKANZBA"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKANZBA"] = value; OnPropertyChanged("WAKANZBA", value); } } //lENGth 2
                 public string WAKDIVISOR { get { if (dwMaster == null) return ""; return dwMaster["WAKDIVISOR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKDIVISOR"] = value; OnPropertyChanged("WAKDIVISOR", value); } } //lENGth 2
                 public double WAKEAFAKTM { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKEAFAKTM"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKEAFAKTM"] = value; OnPropertyChanged("WAKEAFAKTM", value); } } //lENGth 0
                 public double WAKEAFAKTR { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKEAFAKTR"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKEAFAKTR"] = value; OnPropertyChanged("WAKEAFAKTR", value); } } //lENGth 0
                 public string WAKDISPOKZ { get { if (dwMaster == null) return ""; return dwMaster["WAKDISPOKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKDISPOKZ"] = value; OnPropertyChanged("WAKDISPOKZ", value); } } //lENGth 1
                 public string WAKSTBR { get { if (dwMaster == null) return ""; return dwMaster["WAKSTBR"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKSTBR"] = value; OnPropertyChanged("WAKSTBR", value); } } //lENGth 1
                 public string WAKLLEIST { get { if (dwMaster == null) return ""; return dwMaster["WAKLLEIST"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKLLEIST"] = value; OnPropertyChanged("WAKLLEIST", value); } } //lENGth 4
                 public string WAKRLEIST { get { if (dwMaster == null) return ""; return dwMaster["WAKRLEIST"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKRLEIST"] = value; OnPropertyChanged("WAKRLEIST", value); } } //lENGth 4
                 public string WAKRBEM { get { if (dwMaster == null) return ""; return dwMaster["WAKRBEM"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKRBEM"] = value; OnPropertyChanged("WAKRBEM", value); } } //lENGth 17
                 public double WAKNET { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKNET"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKNET"] = value; OnPropertyChanged("WAKNET", value); } } //lENGth 0
                 public double WAKBRUT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKBRUT"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKBRUT"] = value; OnPropertyChanged("WAKBRUT", value); } } //lENGth 0
                 public string WAKROSTA { get { if (dwMaster == null) return ""; return dwMaster["WAKROSTA"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKROSTA"] = value; OnPropertyChanged("WAKROSTA", value); } } //lENGth 1
                 public string WAKSBSTUE { get { if (dwMaster == null) return ""; return dwMaster["WAKSBSTUE"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKSBSTUE"] = value; OnPropertyChanged("WAKSBSTUE", value); } } //lENGth 1
                 public double WAKEARUE { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKEARUE"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKEARUE"] = value; OnPropertyChanged("WAKEARUE", value); } } //lENGth 0
                 public double WAKSTICH { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKSTICH"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKSTICH"] = value; OnPropertyChanged("WAKSTICH", value); } } //lENGth 0
                 public string WAKSCHIEART { get { if (dwMaster == null) return ""; return dwMaster["WAKSCHIEART"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKSCHIEART"] = value; OnPropertyChanged("WAKSCHIEART", value); } } //lENGth 1
                 public string WAKSCHIENE { get { if (dwMaster == null) return ""; return dwMaster["WAKSCHIENE"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKSCHIENE"] = value; OnPropertyChanged("WAKSCHIENE", value); } } //lENGth 5
                 public double WAKLAENG { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKLAENG"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKLAENG"] = value; OnPropertyChanged("WAKLAENG", value); } } //lENGth 0
                 public double WAKEINL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKEINL"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKEINL"] = value; OnPropertyChanged("WAKEINL", value); } } //lENGth 0
                 public double WAKSPANNV { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKSPANNV"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKSPANNV"] = value; OnPropertyChanged("WAKSPANNV", value); } } //lENGth 0
                 public double WAKSPANNB { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKSPANNB"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKSPANNB"] = value; OnPropertyChanged("WAKSPANNB", value); } } //lENGth 0
                 public string WAKSPANNF { get { if (dwMaster == null) return ""; return dwMaster["WAKSPANNF"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKSPANNF"] = value; OnPropertyChanged("WAKSPANNF", value); } } //lENGth 2
                 public double WAKVERSATZ { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKVERSATZ"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKVERSATZ"] = value; OnPropertyChanged("WAKVERSATZ", value); } } //lENGth 0
                 public string WAKVARKZ { get { if (dwMaster == null) return ""; return dwMaster["WAKVARKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKVARKZ"] = value; OnPropertyChanged("WAKVARKZ", value); } } //lENGth 1
                 public double WAKABFFDZ { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKABFFDZ"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKABFFDZ"] = value; OnPropertyChanged("WAKABFFDZ", value); } } //lENGth 0
                 public double WAKUSEDFDZ { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKUSEDFDZ"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKUSEDFDZ"] = value; OnPropertyChanged("WAKUSEDFDZ", value); } } //lENGth 0
                 public string WAKFILLER { get { if (dwMaster == null) return ""; return dwMaster["WAKFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKFILLER"] = value; OnPropertyChanged("WAKFILLER", value); } } //lENGth 22
                 public double WAKAENZL { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKAENZL"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKAENZL"] = value; OnPropertyChanged("WAKAENZL", value); } } //lENGth 0
                 public string WAKAENB { get { if (dwMaster == null) return ""; return dwMaster["WAKAENB"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKAENB"] = value; OnPropertyChanged("WAKAENB", value); } } //lENGth 8
                 public double WAKAEND { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKAEND"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKAEND"] = value; OnPropertyChanged("WAKAEND", value); } } //lENGth 0
                 public string WAKNEUB { get { if (dwMaster == null) return ""; return dwMaster["WAKNEUB"].ToString(); } set { if (dwMaster == null) return; dwMaster["WAKNEUB"] = value; OnPropertyChanged("WAKNEUB", value); } } //lENGth 8
                 public double WAKNEUD { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["WAKNEUD"].ToString()); } set { if (dwMaster == null) return; dwMaster["WAKNEUD"] = value; OnPropertyChanged("WAKNEUD", value); } } //lENGth 0
        */
        #endregion
    }
}
